﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="DC_CommandCommittee.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.DC_CommandCommittee" %>
<%@ Register src="../Controls/EmployeeTypeCombo.ascx" tagname="EmployeeTypeCombo" tagprefix="uc1" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc2" %>
<asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">  
 
  <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
   <script type="text/javascript">
       function openProjectDetails(id, Name, RefNo, ApvDate) 
       {
           radopen("DC_CmdCommitteeDtls.aspx?ParSequence=" + id + "&Name=" + Name + "&RefNo=" + RefNo + "&ApvDate=" + ApvDate, "ProjectDtls");
           return false;
       }
   </script>


<script type="text/javascript">   
    
           function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
          } 
          
</script>
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

       <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>
    
    
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
    <telerik:RadWindow 
        id="ProjectDtls" 
        runat="server"
        showcontentduringload="false"
        VisibleStatusbar="false"
        title="รายละเอียดแนบท้ายคำสั่ง"
        width="800px"
        Height="600px"        
        Modal="true"
        behaviors="Close">
    </telerik:RadWindow>
</Windows>

</telerik:RadWindowManager>
    
    <title></title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" /> 
    

        <table align="center" width ="980px" >
        <tr>
            <td align="left" class="tableHeader">
                คำสั่งแต่งตั้งคณะกรรมการ</td>
        </tr>
        </table>
        <table width ="980px" align = "center" >
        <tr>
        <td >
        <asp:Panel ID="PanelGrid" 
            runat="server" width ="970px">
          <telerik:RadGrid ID="RadGrid2" runat="server" 
                    AllowFilteringByColumn="True" 
                    AllowAutomaticDeletes="True"
                    AllowMultiRowEdit="True" 
                    AllowMultiRowSelection="True" AllowPaging="True" 
                    AllowSorting="True" 
                    AutoGenerateColumns="False" EnableAJAX="True" 
                    EnableAJAXLoadingTemplate="True" GridLines="None" 
                    OnItemCommand="RadGrid2_ItemCommand" Skin="Outlook" width ="950px">
                    <MasterTableView 
                        AllowMultiColumnSorting="True" CellSpacing="-1" 
                        ClientDataKeyNames="cmd_seq" 
                        CommandItemDisplay="Top" 
                        DataKeyNames="cmd_seq" 
                        InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                        <CommandItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                            CommandName="InitInsert" 
                                            Visible="<%# !RadGrid2.MasterTableView.IsItemInserted && RadGrid2.EditIndexes.Count <= 0 %>"> <img alt="" src="../Images/Buttons/AddRecord.gif" 
                                            style="border: 0px; vertical-align: middle;" />จัดทำคำสั่งแต่งตั้งคณะกรรมการ</asp:LinkButton>
                                        &nbsp;&nbsp;
                                    </td>
                                    <td align="right">
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
  
                        <ExpandCollapseColumn Visible="True">
                        </ExpandCollapseColumn>
                                <GroupByExpressions>
                            <telerik:GridGroupByExpression>                               
                                       <GroupByFields >                                       
                                          <telerik:GridGroupByField 
                                        FieldName="cmd_status" 
                                        HeaderText="Type" />                                     
                                       </GroupByFields>                           
                                
                                   <SelectFields>
                                    <telerik:GridGroupByField 
                                        FieldName="cmd_status_name" 
                                        HeaderText=" " 
                                        HeaderValueSeparator = " " />
                                                       
                                </SelectFields>                                
                                      
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions>               
          
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" 
                                EditText="คลิกเพื่อแก้ไขข้อมูล">
                                 <HeaderStyle HorizontalAlign="Center" Width="5%" />
                                <ItemStyle HorizontalAlign="Center" Width="5%" />
                            </telerik:GridEditCommandColumn>                       
                       
                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" 
                                ConfirmDialogType="RadWindow" ConfirmText="ลบข้อมูลที่เลือก?" 
                                Text="คลิกเพื่อลบข้อมูล" UniqueName="column1">
                                <HeaderStyle HorizontalAlign="Center" Width="5%" />
                                <ItemStyle HorizontalAlign="Center" Width="5%" />
                            </telerik:GridButtonColumn>
                            
                            <telerik:GridTemplateColumn 
                                AutoPostBackOnFilter="true" 
                                ShowFilterIcon="false" 
                                CurrentFilterFunction="Contains" 
                                DataField="cmd_no" 
                                FilterControlWidth="100%" 
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderStyle-Width = "100px"
                                HeaderText="เลขที่" >              
                                <ItemTemplate>   
                                    <asp:LinkButton ID="targetControl" runat="server" 
                                        Text='<%# Eval("cmd_ref_no") %>' 
                                        OnClientClick='<%# string.Format("return openProjectDetails(\"{0}\",\"{1}\",\"{2}\",\"{3}\");"
                                                        , Eval("cmd_seq"),Eval("cmd_name"),Eval("cmd_ref_no"),Eval("approved_date")) %>'>
                                    </asp:LinkButton>           
                                </ItemTemplate>               
                            </telerik:GridTemplateColumn>                          
                                                                             
            <telerik:GridTemplateColumn 
                AutoPostBackOnFilter="true" ShowFilterIcon="false" 
                CurrentFilterFunction="Contains" DataField="approved_date" 
                FilterControlWidth="100%" 
                HeaderStyle-HorizontalAlign="Center" HeaderText="ลงวันที่" >
                  <HeaderStyle HorizontalAlign="Center" Width="100px" />
                  <ItemStyle HorizontalAlign="Center" Width="100px" />                                
                    <ItemTemplate>              
                        <%# Eval("approved_date", "{0:dd/MM/yyyy}") %>
                    </ItemTemplate>                
                                
                <HeaderStyle HorizontalAlign="Center" />
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn 
                AutoPostBackOnFilter="true" 
                ShowFilterIcon="false" 
                CurrentFilterFunction="Contains" 
                DataField="cmd_name" 
                FilterControlWidth="100%" 
                HeaderStyle-HorizontalAlign="Center" 
                HeaderText="เรื่อง" 
                UniqueName = "cmd_name">
                <HeaderStyle HorizontalAlign="Center" Width="200px" />                    
               
                <HeaderStyle HorizontalAlign="Center" />
                </telerik:GridBoundColumn>  
 
                 <telerik:GridBoundColumn 
                 Display="false"
                 Visible = "false"     
                 DataField="cmd_seq" 
                 UniqueName = "cmd_seq">
                 </telerik:GridBoundColumn> 
                 
                 <telerik:GridBoundColumn 
                 Display="false"
                 Visible = "false"     
                 DataField="cmd_name" 
                 UniqueName = "1">
                 </telerik:GridBoundColumn> 
            
            <telerik:GridBoundColumn 
                 Display="false"
                 Visible = "false"     
                 DataField="cmd_ref_no" 
                 UniqueName = "2">
                 </telerik:GridBoundColumn>                  
                 <telerik:GridBoundColumn 
                 Display="false"
                 Visible = "false"     
                 DataField="approved_date" 
                 UniqueName = "3">
                 </telerik:GridBoundColumn>                           
                <telerik:GridTemplateColumn 
                    AutoPostBackOnFilter="true" ShowFilterIcon="false" 
                    CurrentFilterFunction="Contains" 
                    DataField="approved_name" 
                    FilterControlWidth="100%" 
                    HeaderStyle-HorizontalAlign="Center" 
                    HeaderText="อนุมัติโดย" >
                  <HeaderStyle HorizontalAlign="Center" Width="40%" />
                  <ItemStyle HorizontalAlign="Center" Width="40%" />
                                
                <ItemTemplate>              
                     <%# Eval("approved_name")%>
                </ItemTemplate>
       
                <HeaderStyle HorizontalAlign="Center" />
            </telerik:GridTemplateColumn>          
                 
                        </Columns>
                         
                        <EditFormSettings EditFormType="WebUserControl"  
                            UserControlName="../UserControls/DC_CommandCommittee.ascx">
                            <EditColumn UniqueName="EditCommandColumn1"                             
                            >
                            </EditColumn>
                        </EditFormSettings>
                        <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                    </MasterTableView>
                    <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" 
                        EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                    </ClientSettings>
                </telerik:RadGrid>
            </asp:Panel>
                </td>
                </tr>
                </table>

</asp:Content>
